/*********************************************************************************
Organization 					: 				Georgia Institute of Technology
  
Institute 						:				Cognitive Computing Group(CCL)
 
Authors							: 				Santiago Ontanon
 												
Class							:				WoodCondition
 
Function						: 				Provides a class for holding 
												the wood condition class
****************************************************************************/
package planninglanguage.softconditions;

import mre.MRE;
import base.WargusGameState;


public class AbsoluteWoodSoftCondition extends SoftCondition {
	int m_minWood;
	public AbsoluteWoodSoftCondition(int a_minWood)
	{
		m_minWood = a_minWood;
	}
	
	public String toString(int tabs) {
	  String n = super.toString(tabs);
	  n = n + "Min wood is :" + m_minWood;
	  return n;
	}	
	public float test(WargusGameState a_gameState)
	{
		if (a_gameState.getPlayer().getWood()-MRE.allocated_wood >= m_minWood) return 1.0f;
		   else return (a_gameState.getPlayer().getWood()-MRE.allocated_wood)/((float)m_minWood);					
	}
	
}
